import configUrl from '@/assets/js/config/config.js';

// matrix_product_url: "http://39.108.147.106:8096/api/v1",
// beetle_api_url: "http://172.16.3.192:8081",
// ucloud2_url: "http://39.108.147.106:8095/api/v1",
// beetle_plan_url: "http://39.108.147.106:5003/api/v1",
// unused
// sys_config_url: "http://39.108.147.106:8098/api/v1",
// beetle_auth_url: "http://39.108.147.106:5001/api/v1",
// beetle_ui_url: "http://39.108.147.106:8080/beetle/App/main.html",
// ucloud_master_url: "http://39.108.147.106:5002",
// froala_upload_url: "http://39.108.147.106:8096/api/v1/attachment/froalaUpload",
// axure_prototype_url: "http://39.108.147.106:8091",
// ticketed_url: "http://itsm.winit.com.cn/otrs/index.pl?Action=AgentTicketZoom,TicketID=",

const beetle_url = "http://172.16.3.192:5002/api/v1";
const beetle_plan_url = "http://172.16.3.192:5003/api/v1";

let ActionUrl = {
    user: {
        login: {
            url: configUrl.beetle_auth_url + '/login/?user_name={0}&user_pass={1}',
            type: 'get'
        },
        getUserInfoByTokenId: {
            url: configUrl.beetle_auth_url + '/login/info?token_id={0}',
            type: 'get'
        },
        logout: {
            url: configUrl.beetle_auth_url + '/login/login_out?token_id={0}',
            type: 'get'
        }
    },
    // 区域管理
    area: {
        getAll: {
            url: configUrl.ucloud2_url + '/zone/getAll',
            type: 'get'
        },
        create: {
            url: configUrl.ucloud2_url + '/zone/createZone',
            type: 'post'
        },
        update: {
            url: configUrl.ucloud2_url + '/zone/updateZone',
            type: 'post'
        },
        delete: {
            url: configUrl.ucloud2_url + '/zone/deleteZone?zoneId={0}',
            type: 'get'
        }
    },
    // 节点管理
    node: {
        getAll: {
            url: configUrl.ucloud2_url + '/agent/allAgents',
            type: 'get'
        },
        create: {
            url: configUrl.ucloud2_url + '/agent/createAgent',
            type: 'post'
        },
        update: {
            url: configUrl.ucloud2_url + '/agent/rentAgent?tokenId={0}',
            type: 'post'
        },
        delete: {
            url: configUrl.ucloud2_url + '/agent/deleteAgent?agentId={0}',
            type: 'get'
        },
        recovery: {
            url: configUrl.ucloud2_url + '/agent/clearAgent?id={0}&tokenId={1}',
            type: 'get'
        },
        getProject: {
            url: configUrl.matrix_product_url + '/projectPlan/getProjectPlans',
            type: 'get'
        }
    },
    // 应用配置
    config: {
        getAll: {
            url: configUrl.ucloud2_url + '/app/getAll',
            type: 'get'
        },
        getFile: {
            url: configUrl.beetle_api_url + '/beetle/config/getConfigsByAppNameAndUrl?appName={0}&rootDir={1}',
            type: 'get'
        },
        create: {
            url: configUrl.ucloud2_url + '/app/createApp',
            type: 'post'
        },
        update: {
            url: configUrl.ucloud2_url + '/app/updateApp',
            type: 'post'
        },
        delete: {
            url: configUrl.ucloud2_url + '/app/deleteApp?appId={0}',
            type: 'get'
        }
    },
    // 发布面板
    publish: {
        getAll: {
            url: configUrl.ucloud2_url + '/task/getAppTasks',
            type: 'get'
        },
        getBranchByAppName: {
            url: configUrl.beetle_api_url + '/beetle/project/projectListByTrunk?trunkName={0}&tokenId={1}',
            type: 'get'
        },
        getVersionByBranchName: {
            url: configUrl.beetle_api_url + '/beetle/project/editionInfoList?projectName={0}&tokenId={1}',
            type: 'get'
        },
        update: {
            url: configUrl.ucloud2_url + '/task/saveTask',
            type: 'get'
        },
        stop: {
            url: configUrl.ucloud2_url + '/task/stopApp?appId={0}',
            type: 'get'
        },
        getDefaultBranch: {
            url: configUrl.beetle_plan_url + '/project_plan/getProjectForUcloud?token_id={0}&plan_id={1}&app_name={2}',
            type: 'get'
        },
    },
    // 申请列表
    apply: {
        getAll: {
            url: beetle_url + '/apply_record/?token_id=304a034a7a6f11e8b38b005056b12bbc&isOnlyoverdue={0}&isOnlyOneMouth={1}',
            type: 'get'
        },
        getPlan: {
            url: beetle_plan_url + '/project_plan/getPlanList?token_id=304a034a7a6f11e8b38b005056b12bbc&isShowOnline=false',
            type: 'get'
        },
        getSize: {
            url: beetle_url + '/load_level/?token_id={0}',
            type: 'get'
        },
        getUcloudList: {
            url: beetle_url + '/agent/?token_id=304a034a7a6f11e8b38b005056b12bbc&is_only_free=true',
            type: 'get'
        },
        create: {
            url: beetle_url + '/apply_record/add?type={0}&applicant_id={1}&expect_recover_date={2}&token_id={3}&plan_name={4}&plan_id={5}&start_date={6}&applicant_name={7}&desc={8}',
            type: 'get'
        },
        approval: {
            url: beetle_url + '/apply_record/audit?audit_id={0}&added_desc={1}&record_id={2}&token_id={3}&level_name={4}&audit_name={5}',
            type: 'get'
        },
        distribution: {
            url: beetle_url + '/apply_record/assign?record_id={0}&token_id={1}&agent_ip={2}',
            type: 'get'
        },
        recovery: {
            url: beetle_url + '/apply_record/recoverAgent?token_id=304a034a7a6f11e8b38b005056b12bbc&record_id={0}',
            type: 'get'
        }
    }
};

export default ActionUrl;